import useApp from "@/stores/app";
import { toRef } from "vue";

/**
 *
 * return {
 *  isLogged ：boolean 是否已登录
 *  islogging: 是否正在登录
 *
 * }
 *
 */
function useLogin() {
  const app = useApp();

  const isLogged = toRef(app, "isLogined");
  const islogging = toRef(app, "isLoginPending");

  return {
    isLogged,
    islogging,
  };
}

export default useLogin;
